package com.example.qiniutest.image.tonken.controller;

import com.example.qiniutest.image.tonken.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/qiniu")
public class TonkenController {

    @Autowired
    TokenService tokenService;

    @GetMapping("/token")
    public String getToken(ModelMap model){
        model.addAttribute("token",tokenService.getToken());
        return "index";
    }
}
